create table T(id int primary key, k int not null, name varchar(16),index (k))engine=InnoDB;
insert into T (id,k,name) values (100,1,'a'),(200,2,'b'),(300,3,'c');

begin ;
select * from T limit 1;

alter TABLE T add column f int;

begin;
update T set name = 'd' where name = 'c';

begin;
update T set name = 'e' where name = 'a';

begin;
update T set name = 'd' where k = 1;

begin;
update T set name = 'e' where k = 2;

begin;
update T set name = 'd' where name = 'e' limit 1;

begin;
update T set name = 'e' where name = 'b' limit 1;

innodb_lock_wait_timeout
innodb_deadlock_detect

16.
show variables like "innodb_io_capacity";
show variables like "innodb_flush_neighbors";
show variables like "innodb_file_per_table";

alter table t engine = InnoDB;
analyze table T;
optimize table t;

show processlist;

select blocking_pid from sys.schema_table_lock_waits;
select * from sys.innodb_lock_waits where locked_table=test.t\G